package com.pro.meeting.web.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pro.meeting.bean.MeetingPub;
import com.pro.meeting.service.MeetingPubService;


@Controller
@RequestMapping("meetingPub")
public class MeetingPubController {
	@Autowired
	MeetingPubService meetingPubService;
	//添加会议
	@ResponseBody
	@RequestMapping("add")
	public String add(MeetingPub meetingPub){
		int num=meetingPubService.add(meetingPub);
		return ""+num;
	}
	//我的会议
	@RequestMapping("getByUid")
	@ResponseBody
	public List<MeetingPub> getByUid(@RequestParam("uid")String uid){
		
		return meetingPubService.getByUid(uid);
	}
	//根据会议ID，查看详情
	@RequestMapping("getByPid")
	public String getByPid(@RequestParam("pid")String pid,HttpServletRequest request){
		MeetingPub meetingPub= meetingPubService.getByPid(pid);
		request.setAttribute("meetingPub",meetingPub);
		
		return "/pages/weixin/meetingPub/meetingPub_view.jsp";
	}
}
